import { Typography } from 'antd'
import { FC } from 'react'
import PropComponent from './PropComponent'
const { Title, Paragraph } = Typography

export type propsType = {
  title?: string
  desc?: string
  disabled?: boolean
}

const QuestionInfo: FC<propsType> = props => {
  const { title = '问卷标题', desc = '问卷描述' } = props
  return (
    <div style={{ textAlign: 'center' }}>
      <Title style={{ fontSize: '24px' }}>{title}</Title>
      <Paragraph>
        {desc.split('\n').map((item, index) => (
          <span key={index}>
            {item}
            <br />
          </span>
        ))}
      </Paragraph>
    </div>
  )
}

export const questionInfoConfig = {
  title: '问卷信息',
  type: 'questionInfo',
  PropComponent,
  Component: QuestionInfo,
}

export default QuestionInfo
